Image processing method, recording medium with recorded image processing program and image processing apparatus

ABSTRACT

An image processing method for carrying out predetermined correction processing with respect to one or more items regarding the quality of color images and the image processing method comprises a judgment step for judging the necessity/nonnecessity of correction with respect to each of the above-mentioned items and a correction processing step for carrying out the predetermined correction processing with respect to the item judged as required to be corrected at the above-mentioned judgment step.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a divisional application of Ser. No. 11/727,560,filed Mar. 27, 2007, which is a divisional application of Ser. No.09/291,358, filed Apr. 14, 1999, now U.S. Pat. No. 7,215,812, issued May8, 2007, which claims priority from Japanese patent application No.10-102756, filed Apr. 14, 1998, the contents of which are herebyincorporated by reference.

FIELD OF THE INVENTION

The present invention relates to execution of predetermined correctionregarding the image quality of color images captured by a digitalcamera, a scanner and the like. More particularly, the present inventionrelates to an image correction method to be carried out at the time ofprocessing, editing and the like of color images, to a readablerecording medium with a recorded processing program using the imagecorrection method, and to an image processing apparatus to which theimage correction method is applied.

BACKGROUND OF THE INVENTION

In conventional computer processing, color images have been processedand edited by using predetermined program software. A program forcorrecting the image quality of color images has been known as a programfor supporting this editing operation, and has been built in aspecial-purpose image processing apparatus or provided on the market inthe form of ROM, for example.

Unlike the image correction of manuscript images captured by a colorcopier or the like, the image correction of color images in theprocessing and editing operations using a computer is required toreflect the intention of the editor. Therefore, in the processingprocedure in accordance with a conventional image correction program,the necessity/nonnecessity of correction processing is judged by theeditor. When image correction is instructed by the editor, the imagecorrection program is executed, and predetermined correction processingis carried out.

FIG. 12 is a flowchart showing a conventional processing procedure forcorrecting plural color images all together.

In accordance with this flowchart, the editor displays plural imagesphotographed by a digital camera for example on a display device, suchas a CRT, and determines images required to be corrected. The editorinputs a command for instructing image correction to run an imagecorrection program. In accordance with this image correction program,when plural files to be subjected to image correction and the outputdestinations of the files after correction are input by the editorinteractively or in a form required for information input (#101 and#102), first, a processing file count value n is set at “1” (#103).Next, the image data of the file designated first is read (#104). Afterpredetermined image correction processing (contour correction, contrastcorrection and the like, for example) is carried out (#105), the fileincluding the image data is output to the designated output destination(a memory for storing the data, a printer and the like) (#106).

Next, the count value n is incremented by one (#107), and whether thecount value n is larger than the designated number N of files is judged(#108). If the count value n is not larger than the number N (NO at#108), the procedure returns to #104, and the same predetermined imageprocessing is carried out for the next image file (#104 to #108). If thecount value n is larger than the designated total number N of files (YESat #108), it is judged that the image correction processing has beencompleted for the files, and the processing ends.

In the conventional image correction program, the editor judges thenecessity/nonnecessity of image correction, and on the basis of theresult of the judgment, the predetermined image correction processing iscarried out for a color image required to be corrected. Therefore, inthe case when plural photographed color images are corrected forexample, the editor must judge the necessity/nonnecessity of imagecorrection for each color image. This becomes burdensome to the editor.In addition, since the designated plural color images are corrected alltogether, in the case when images not required to be corrected areincluded, image quality will be deteriorated by the correction, andimage correction must be carried out again. This may lower processingefficiency.

SUMMARY OF THE INVENTION

In order to solve the above-mentioned problems, the present invention isintended to provide an image processing method capable of carrying outimage correction efficiently, a readable recording medium with arecorded program for the processing method and an image processingapparatus to which the processing method is applied.

The present invention relates to an image processing method for carryingout predetermined correction processing with respect to one or moreitems regarding the quality of color images. The image processing methodjudging the necessity of correction with respect to each of theabove-mentioned items and a correction processing for carrying out thepredetermined correction processing with respect to the item judged asrequired to be corrected during judgment.

With the above-mentioned configuration, in the case when thepredetermined image correction processing is carried out with respect toone or more items regarding the image quality of color images, unlikethe case when correction is carried out in comparison with predeterminedvalues having been determined simply, the necessity/nonnecessity ofcorrection is judged comprehensively with respect to each item on thebasis of the whole condition of each image. Correction processing isthen carried out with respect to items required to be corrected.

In addition, the present invention includes, as correction judgmentitems, at least one of a sunset judgment used to judge whether a colorimage is a sunset scene or not, a color covering judgment used to judgewhether the whole of a color image is covered with a specific color ornot, a contrast judgment used to judge whether a color image has anormal contrast or not, and a sharpness judgment used to judge whether acolor image has a normal sharpness or not.

With the above-mentioned configuration, at least one of the sunsetjudgment, color covering judgment, contrast judgment and sharpnessjudgment is carried out. When it is judged that correction is necessary,the predetermined correction processing with respect to the judgmentitem is carried out for a color image.

Furthermore, the present invention relates to a readable recordingmedium with a recorded program for carrying out the predeterminedcorrection processing with respect to one or more items regarding theimage quality of color images. The processing program comprising judgingthe necessity of correction with respect to each item described aboveand correction processing for carrying out the predetermined correctionprocessing with respect to the item judged as required to be correctedat the above-mentioned judgment is stored in the readable recordingmedium.

Moreover, the present invention relates to an image processing apparatusfor carrying out the predetermined correction processing with respect toone or more items regarding the image quality of color images. The imageprocessing apparatus comprises a judgment device to judge the necessityof correction with respect to each item described above and a correctiondevice to carry out the predetermined correction processing with respectto the item judged as required to be corrected during judgment.

Additionally, the image processing apparatus of the present inventioncomprises an image designation device to designate plural color imagesto be corrected, and a correction processing control device to judge thenecessity of correction for the color images designated by the imagedesignation device and for carrying out the predetermined correctionprocessing on the basis of the result of the judgment.

These and other objects, advantages and features of the invention willbecome apparent from the following description thereof taken inconjunction with the accompanying drawings which illustrate specificembodiments of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

In the following description, like parts are designated by likereference numbers throughout the several drawings.

FIG. 1 is a block diagram showing an embodiment of an image processingapparatus in accordance with the present invention;

FIG. 2 is a main flowchart showing the processing procedure of imagecorrection processing;

FIG. 3 is a flowchart showing the processing procedure of thenecessity/nonnecessity of image correction;

FIG. 4 is a flowchart showing the processing procedure of a sunsetjudgment;

FIG. 5 is a graph showing a method of calculating a variance value for ahistogram;

FIG. 6 is a flowchart showing the processing procedure of a colorcovering judgment;

FIG. 7 is a graph showing an example of the shape of a histogram for huedata not judged as color covering in the color covering judgment;

FIG. 8 is a graph showing an example of the shape of a histogram for huedata judged as color covering in the color covering judgment;

FIG. 9 is a flowchart showing the processing procedure of a contrastjudgment;

FIG. 10 is a graph illustrating a method of calculating an index valuefor the contrast judgment by using a histogram for image data;

FIG. 11 is a view showing an image processing apparatus configured byusing a computer system; and

FIG. 12 is a flowchart showing a conventional processing procedure forcorrecting plural color images all together.

DETAILED DESCRIPTION OF THE INVENTION

Embodiments in accordance with the present invention shown in theaccompanying drawings will be described below in detail.

FIG. 1 is a block diagram showing an embodiment of an image processingapparatus in accordance with the present invention.

The image processing apparatus shown in FIG. 1 comprises a control unit2, a ROM (Read Only Memory) 3, a RAM (Random Access Memory) 4, an imagememory 5, a GUI (Graphical User Interface) 6, an I/F 7, an input device8, a display device 9 and an external storage device 10. The controlunit 2, the ROM 3, the RAM 4, the image memory 5, the GUI 6 and the I/F7 are built in an apparatus body 1. The input device 8 and the displaydevice 9 are connected to the control unit 2 via the GUI 6, and theexternal storage device 10 is connected to the control unit 2 via theI/F 7.

The control unit 2 is provided with an image file input/outputprocessing unit 201, a correction necessity/nonnecessity judgment unit202 and an image correction unit 203 for carrying out image processing.

The image file input/output processing unit 201 is used to read colorimages (electric images) of an image file having been input from theinput device 8 from a recording medium (the RAM 4, the external storagedevice 10, an internal storage device if provided, or the like, forexample), and to output corrected image data to a predetermined outputdestination (a recording medium, a printer, other peripheral devices orthe like) having been input from the input device 8.

The correction necessity/nonnecessity judgment unit 202 is used to judgewhether preset image correction is required or not for color images readfrom a recording medium. The correction necessity/nonnecessity judgmentunit 202 has at least a sunset judgment, a color covering judgment, acontrast judgment and a sharpness judgment as judgment items. The sunsetjudgment is used to judge whether a color image is a sunset scene ornot, and the color covering judgment is used to judge whether the wholeof a color image is covered with a specific color (a greenish color whena photograph is taken by using a fluorescent lamp as a light source, forexample) or not. In addition, the contrast judgment is used to judgewhether a color image has a normal contrast or not, and the sharpnessjudgment is used to judge whether a color image has a normal sharpnessor not.

The image correction unit 203 is used to carry out image correction foritems corresponding to a color image judged as “correction necessary” onthe basis of the judgment result of the correctionnecessity/nonnecessity judgment unit 202. If an image different from asunset scene is judged that the image is covered with red for example,the red component on the whole of the color image is weakened to correctthe color covering.

The ROM 3 is a memory wherein the program for the above-mentioned imagecorrection processing has been stored. The RAM 4 is used to temporarilystore various data calculated by the image correction processing.Furthermore, the image memory 5 is used to store color image data readfrom a recording medium to carry out image correction judgment and imagecorrection. The image memory 5 has an image data storage capacity for atleast three images. Image data constituting color images is separatedinto the color components R, G and B, and stored.

The display device 9 is used to display various matters, such as anoperation menu, processing conditions and processing results (includingmonitor display of corrected color images), and is formed of anelectronic display, such as a CRT (Cathode Ray Tube) or an LCD (LiquidCrystal Display). Image correction items are represented by icons on theoperation menu of the display device 9, whereby the operator can carryout image correction processing as described below by selecting theicons.

The external storage device 10 functions as a storage device for imagedata to be corrected or a storage device for corrected image data, andreads and writes image data on external recording media such as floppydisks, optical disks, magnetic disks and magneto-optic disks.

Next, the image correction processing of the image processing apparatuswill be described below referring to the flowcharts of FIGS. 2 to 5 andthe histogram of image data of FIG. 6.

FIG. 2 is a flowchart showing the basic processing procedure of imagecorrection processing. When image correction is instructed by theoperator via the input device 8 in accordance with an operation menushown on the display device 9, a processing program shown in FIG. 2 isread from the ROM 3, and image correction processing is carried out inaccordance with the processing program.

When plural image files for image correction and an output destinationafter image correction of each image file are input by the operator (#1and #3), a processing file count value n is first set at “1” (#5). Next,the image data of the first image file is read from a designatedrecording medium to the image memory 5 (#7). The image data is subjectedto the judgment of the necessity/nonnecessity of preset image correctionitems in accordance with the correction necessity/nonnecessity judgmentprocessing procedure shown in FIG. 2 (#9).

When image correction is judged as necessary on the basis of the imagecorrection necessity/nonnecessity judgment (YES at #11), predeterminedimage correction processing is carried out for items judged as“correction necessary,” and the corrected image data is then output to adesignated output destination (the external storage device 10, a printer(not shown) or the like, for example) (#13 and #15). Furthermore, whenimage correction is judged as unnecessary (NO at #11), image data isoutput as it is to the designated output destination without imagecorrection processing (#15).

Next, the count value n is incremented by only “1” (#17), and whetherthe count value n is larger than the total number N of the designatedimage files or not is judged (#19). If the count value n is not larger(NO at #19), the procedure returns to step #7, and the image correctionnecessity/nonnecessity judgment, the image correction processing and theoutput processing of image data are carried out for the next image filename in the same way (#7 to #15). If the count value n is larger thanthe total number N of the files (YES at #19), it is judged that imagecorrection processing for all the image files has been completed, andthe processing ends.

Next, the image correction necessity/nonnecessity judgment will bedescribed in accordance with the flowchart shown in FIG. 3.

In the image correction necessity/nonnecessity judgment, by using theimage data stored in the image memory 5, a judgment as to whether thecolor image thereof is an image of a sunset scene or not (#21 and #23),a judgment as to whether the color image is color-covered or not (#25and #27), a judgment as to whether the color image is normal in contrastor not (#29 and #31), and a judgment as to whether the color image isnormal in sharpness or not (#33 and #35) are carried out in this order.This order of judgment items is determined to raise judgment efficiencyand judgment accuracy.

In other words, the judgment as to whether the color image is a sunsetscene or not (hereinafter referred to as a sunset judgment) is carriedout on the basis of the histogram distribution of image data of part ofcolor components in the range of red to yellow as described below. Thejudgment as to whether the color image is color-covered or not(hereinafter referred to as a color covering judgment) is carried out onthe basis of the histogram distribution of image data of the whole ofcolor components in the range of red to blue as described below. Sincethe processing load for the color covering judgment is higher than thatfor the sunset judgment, the sunset judgment is carried out earlier thanthe color covering judgment to attain efficient judgment.

Furthermore, the judgment as to whether the color image is normal incontrast or not (hereinafter referred to as a contrast judgment) iscarried out after the sunset judgment and the color covering judgment inview of judgment efficiency, since the contrast judgment can use thehistograms of the image data created at the time of the sunset judgmentand the color covering judgment. A photographed image has sharp edgesjust as a photographed scene taken in cloudy weather although itscontrast is low. In order to be able to judge the contents of such aphotographed scene, the judgment as to whether the color image is normalin sharpness or not (hereinafter referred to as a sharpness judgment) iscarried out after the contrast judgment in consideration of judgmentaccuracy.

At the time of the sunset judgment, an index value for the sunsetjudgment is calculated by using the histogram of hue data (#21) asdescribed below, and this index value is compared with a predeterminedthreshold value to judge whether the color image is a sunset scene ornot (#23). If the color image is a sunset scene (YES at #23), a judgmentresult of “correction unnecessary” is output (#39). The procedurereturns, and if the color image is not a sunset scene (NO at #23), thecolor image is further subjected to the color covering judgment.

At the time of the color covering judgment, an index value for the colorcovering judgment is calculated by using the histogram of the hue data(#25) as described below, and this index value is compared with apredetermined threshold value to judge whether the color image hasundergone the covering of a specific color or not (#27). If the colorimage is not a sunset scene and is color-covered (YES at #27), ajudgment result requiring correction for color covering is output (#37).The procedure returns, and if the color image is not a sunset scene andis not color-covered (NO at #27), the contrast judgment is furthercarried out (#25).

At the time of the contrast judgment, an index value for the contrastjudgment is calculated by using the histograms of the color componentsR, G and B (#29) as described below, and this index value is comparedwith a predetermined threshold value to judge whether the contrast ofthe color image is normal or not (#31). If the color image is not asunset scene, is not color-covered and is normal in contrast (NO at#31), the color image is judged that it is not a sunset scene and isnormal in image quality, and a judgment result of “correctionunnecessary” is output (#39). The procedure returns, and if the colorimage is not a sunset scene and is not color-covered but is abnormal incontrast (YES at #31), the sharpness judgment is further carried out(#35).

At the time of the sharpness judgment, data in the edge region in thecolor image is extracted, an index value for the sharpness judgment iscalculated by using this data (#33), and this index value is comparedwith a preset threshold value to judge whether the sharpness of thecolor image is normal or not (#35).

If the color image is not a sunset scene, is not color-covered and isnormal in both contrast and sharpness (NO at #35), the color image isjudged that it is not a sunset scene and is normal in image quality, anda judgment result of “correction unnecessary” is output (#39). Theprocedure returns, and if the color image is not a sunset scene and isnot color-covered but is abnormal in contrast and sharpness (YES at#35), a judgment result requiring correction for intensifying imageedges is output (#37). The procedure then returns.

Next, the sunset judgment procedure will be described referring to theflowchart of FIG. 4. The flowchart of FIG. 4 corresponds to concreteprocessing procedures conducted at step #21 of FIG. 3.

In the case of the photographed image of a scene wherein a white wall isirradiated with evening sunlight for example, the white wall isorange-colored, and the shade of the color changes spontaneously in therange of red to yellow. Therefore, the sunset judgment is carried out byjudging the distribution condition of the color components in the rangeof red to yellow in the image. More concretely, the sunset judgment iscarried out as described below. Regarding the image data (pixel data)belonging in the range from red to yellow, the product P (=H·S) of thehue data H and the saturation data S thereof, and the product Q (=H·L)of the hue data H and the lightness data L are calculated, P and Q arerepresented by histograms, and the degrees of their dispersion areexamined.

In other words, the image data (pixel data) of the color components R, Gand B stored in the image memory 5 is first converted into the threeattributes of color, i. e., H, L and S, in accordance with theconversion equation shown at the following steps 0 to 3 (#41).

Step 0 (Preparation)

-   {circle around (1)} M=max (R, G, B); m=min (R, G, B)-   {circle around (2)} When M=m, the color is a neutral color, and step    0 advanced to step 1.-   {circle around (3)} r=(M−R)/(M−M); g=(M−G)/(M−m); b=(M−B)/(M−m)

Note that at least one of r, g and b is 0, and that at least one of themis 1.

Step 1 (Calculation of Lightness L)

-   L=(M+m)/2

Step 2 (Calculation of Saturation S)

-   When M=m (neutral color), S=0.0-   When M≠m and L≦0.5, S=(M−m)/(M+m)-   When M≠m and L>0.5, S=(M−m)/(2−M−m)

Step 3 (Calculation of Hue H)

-   When S=0.0 (neutral color), H′=0.0-   When S≠0 and R=M, H′=2+b−g-   When S≠0 and G=M, H′=4+r−b-   When S≠0 and B=M, H′=6+g−r-   H=60H′ (mod 360: the hue of the neutral color is assumed 0)

Next, after the level of the hue data H is converted so that the maximumvalue 360 becomes “255”, the histogram of the hue data H is created at aclass pitch of “1” for example (#43). The hue data H is normalizedherein by “255” because of the following reasons. Since data processingis carried out by using 8-bit data, the processing can be made easy bythis normalization. Furthermore, the judgment accuracy is not muchaffected by this normalization.

Next, the hue data H included in the range of class 64 to class 125 (inthe range of red to yellow) is extracted. The product P (=H·S) of eachof the hue data H and the saturation data S corresponding thereto andthe product Q (=H·L) of each of the hue data H and the lightness data Lcorresponding thereto are calculated (#45).

Next, after the levels of the calculated values P and Q are converted sothat the maximum value becomes “255” (#47), the histograms of thecalculated values P and Q are created at a class pitch of “1” forexample (#49), and the variance values Sp and Sq of each histogram arecalculated (#51). The variance value S can be calculated by using thefollowing equation (1) for a histogram with frequency y corresponding toclass x as shown in FIG. 5.

$\begin{matrix}{S = {\frac{\sum\limits_{i = 1}^{n}\; {x_{i}^{2}y_{i}}}{\sum\limits_{i = 1}^{n}\; y_{i}} - \left( \frac{\sum\limits_{i = 1}^{n}\; {x_{i}y_{i}}}{\sum\limits_{i = 1}^{n}\; y_{i}} \right)^{2}}} & (1)\end{matrix}$

The variance values Sp and Sq are compared with predetermined thresholdvalues Kp and Kq (Kp=850, Kq=1200) corresponding thereto, respectively(#53 and #55). If Sp≧Kp and Sq≧Kq (YES at #53 and #55), it is assumedthat the gradation at the portions in the range of red to yellow in acolor image is wide, and that the red portion is colored by eveningsunlight, whereby the color image is judged as a sunset image (#57). IfSp<Kp or Sq<Kq (NO at #53 or NO at #55), it is assumed that thegradation at the portions in the range of red to yellow in the colorimage is narrow, and that the red portion is not colored by eveningsunlight, whereby the color image is not judged as a sunset image (#59).

Next, the color covering judgment procedure will be described belowreferring to the flowchart of FIG. 6. The flowchart of FIG. 6corresponds to the concrete processing procedures for the step #25 ofFIG. 3.

Color covering is a condition wherein the whole of a color image iscovered with a specific color and the color balance of the color imageis lost such that a photograph taken without flashlight under afluorescent lamp for example becomes greenish on the whole. Therefore,the color covering judgment is carried out by judging the distributioncondition of all the color components in the image. However, since thecontents of the image may sometimes have one specific color, the colorcovering judgment is carried out in this case in consideration of notmisjudging that the image is color-covered.

First, the image data (pixel data) of the color components R, G and Bstored in the image memory 5 is converted into the image data of thethree color attributes H, L and S by the conversion equation shown asthe above-mentioned equation 1 (#61). Next, image data having thelightness data L in the range of about “15” to “85” is extracted (#63).Since the shade of the color cannot be judged accurately at the darkportions and bright portions in the image, this extraction is carriedout so that the image data in these portions is not judged.

Next, a histogram is created for the hue data H corresponding to theextracted lightness data L at a class pitch of “1” for example (#65). Ajudgment is carried out as to whether a predetermined quantity or more(85% or more for example) of the whole image data (pixel data) isintensively distributed in a predetermined range W1 (the range of class20 for example) of a specific color region (#67). Since the presence orabsence of color covering is checked in the whole color region in thecase of the color covering judgment, the processing of normalizing thehue data H by “255” is not carried out in consideration of judgmentaccuracy.

If image data is intensively distributed in a specific color region asshown in FIG. 7 (if 85% or more of image data (pixel data) isdistributed in the predetermined range W1 of a specific color region)(YES at #67), the color image is not judged as color-covered but judgedas a color image having image data intensively distributed (#73). If theimage data is not intensively distributed (NO at #67), a judgment isfurther carried out as to whether a predetermined quantity or more (80%or more for example) of the whole image data (pixel data) is distributedin a predetermined range W2 (>W1, the range of class 50 for example) ofa specific color region (#69).

If 80% or more of image data (pixel data) is intensively distributed inthe predetermined range W2 of a specific color region as shown in FIG. 8(YES at #69), the color image is judged as color-covered by the color(#71). If 80% or more of image data is not distributed intensively (NOat #69), the color image (pixel data) is judged as not color-covered(#73).

Next, the contrast judgment procedure will be described below referringto the flowchart of FIG. 9. The flowchart of FIG. 9 corresponds to theconcrete processing procedures for the step #29 of FIG. 3.

The contrast judgment is carried out by judging whether the image dataof each of the color components R, G and B effectively has used adynamic range or not. In other words, in the case when the histogram ofthe image data is created as shown in FIG. 10, the contrast judgment iscarried out by judging whether the ratio of the range d (d=d1+d3 in FIG.10 for example) of the frequency “0” class in the whole class range D islarger than a predetermined threshold value K or not.

First, a histogram at the level of the class pitch “1” for example iscreated for each of color components R, G and B (#81). Next, the rangesdr, dg and db of the frequency “0” class are calculated for the colorcomponents, respectively (#83), and the ratio dj/D (%) (j=r, g, b) ofthe class range dr, dg, db to the whole class range D (=255) iscalculated (#85). And dj/D is compared with a predetermined thresholdvalue Kj (j=r, g, b) (10% for example), respectively (#87, #89 and #91).If Dj/D≦Kj in all the color components of the image (YES at all thesteps of #87 to #91), the contrast is judged as normal (#93). If Dj/D>Kj(NO at #87, #89 or #91), the contrast is judged as abnormal (#95).

Although the image data of the color components R, G and B is used forthe contrast judgment shown in FIG. 9, the contrast judgment may becarried out by using data converted into H, S and L. In the case whenthe contrast judgment is carried out by using the HSL data, a histogramshould be created for the L (lightness) data among the HSL data, and thesame judgment as described above should be carried out.

Next, the sharpness judgment will be described.

The sharpness judgment is carried out by calculating sharpness by usingthe method disclosed in the U.S. Pat. No. 2,611,723 for example, and bycomparing this sharpness with a predetermined threshold value. Thedetails of the method of calculating the sharpness are omitted. Thesharpness disclosed in the patent publication is obtained by extractingthe image data (pixel data) of the edge portions of an image by using alinear differentiation filter, a quadratic differentiation filter, ahigh frequency filter or a band-pass filter, by calculating a highfrequency component at a pixel position extracted by applying a highfrequency filter to this image data, and by normalizing the intensity ofthe high frequency component of the whole edge region obtained byintegrating the intensity of the high frequency component with respectto the area of the edge region.

If the sharpness is higher than the predetermined threshold value, thesharpness is judged as normal. If the sharpness is not higher than thepredetermined threshold value, the sharpness is judged as abnormal.

As described above, in the color image correction processing, thenecessity/nonnecessity of correction is judged with respect to thecorrection items regarding the preset image quality, and imagecorrection is carried out only for the items required to be corrected.Therefore, correction is not carried out for the color images which arenot required to be corrected, whereby processing efficiency can beenhanced. Furthermore, it is possible to prevent image deterioration dueto image correction carried out for color images which are not requiredto be corrected.

In the above-mentioned embodiment, the sunset judgment, the colorcovering judgment, the contrast judgment and the sharpness judgment aretaken as examples of the judgment items for the necessity/nonnecessityof correction in image quality. However, if the saturation of a colorimage is excessive for example, a judgment as to whether correction forrelieving the excessive saturation is required or not may be included.The judgment as to whether the saturation is normal or not is carriedout by converting the image data of the three primary colors R, G and Binto the image data of the three attributes H, S and L for example, byselecting a predetermined hue, and by comparing the saturation data Scorresponding to the hue with a predetermined threshold value Ks (50% ofthe maximum saturation of the hue for example). If the saturation datais not higher than the threshold value Ks for example, the saturation isjudged as abnormal, and saturation correction processing is carried out.The saturation of the hue is corrected so that the saturation data Sbecomes 60% of the maximum saturation of the hue for example.

Furthermore, in the case when image data has much noise (the noise isnot limited to signal noise, but includes improper image data causedowing to loss or deterioration of image data and required to be excludedfrom desired image data), a judgment as to whether correction foreliminating the noise is required or not may be included.

In addition, although photographed images are taken as examples in theexplanation of the above-mentioned embodiment, the present invention canbe applied to any images, such as images created by computer graphics,images captured by scanners and the like.

Furthermore, although the image processing apparatus provided with theprocessing program for the image processing method in accordance withthe present invention is described in the above-mentioned embodiment, itis possible to configure an image processing apparatus 20 as shown inFIG. 11 by using a computer system wherein the processing program forthe image processing method is stored on an external recording medium23, i.e., a magnetic storage medium, such as a floppy disk or a magnetictape, or an optical storage medium, such as a CD-ROM, an optical disk,an optical card or a magneto-optic disk, and read to a computer body 21via an external storage device 22.

As described above, in accordance with the present invention, when theimage quality of a color image is corrected, the necessity/nonnecessityof correction is judged, and the predetermined image processing iscarried out only when the correction is necessary. Therefore, thenecessity/nonnecessity of image correction is not required to be judgedby the operator, whereby the processing efficiency of image correctionis improved by that amount. In addition, in the case when correction iscarried out for plural color images all together, the present inventionis free from a problem of causing image deterioration due to unnecessaryimage correction which may otherwise be carried out for color images notrequired to be corrected.

Furthermore, since at least one of the sunset judgment, the colorcovering judgment, the contrast judgment and the sharpness judgment isincluded as a correction judgment item, the necessity/nonnecessityjudgment for proper image correction can be carried out for photographedcolor images.

Moreover, when the image quality of a color image is corrected, thenecessity/nonnecessity of correction is judged, and only when thecorrection is necessary, the processing program for carrying out thepredetermined image processing is recorded on a readable recordingmedium. By applying this readable recording medium to a computer system,an image processing apparatus can be configured simply.

1. A judging method of sunset scene, comprising: converting colorcomponents R, G and B of an image data into hue data, lightness data andsaturation data; calculating first products of the hue data and thesaturation data of the pixel of red and yellow in the image data;calculating second products of the hue data and the lightness data ofthe pixel of red and yellow in the image data; and judging whether theimage data is the sunset scene based on first and second products.
 2. Ajudging method of sunset scene according to claim 1, further comprising:calculating a histogram of the products of the hue data and thesaturation data; calculating a histogram of the products of the hue dataand the lightness data; calculating a variance of the two histograms;and wherein judging whether the image data is the sunset scene based onthe variance.
 3. An image processing apparatus, comprising: a memorywhich stores an image data of a color image; a judge section whichjudges whether correction of the color image based on a quality ofsunset scene, wherein the judge section comprises; a unit forcalculating first products of the hue data and the saturation data ofthe pixel of red and yellow in the image data; a unit for calculatingsecond products of the hue data and the lightness data of the pixel ofred and yellow in the image data; and a unit for judging whether theimage data is the sunset scene based on first and second products.
 4. Animage processing apparatus according to claim 3, further comprising: aunit for calculating a histogram of the products of the hue data and thesaturation data; a unit for calculating a histogram of the products ofthe hue data and the lightness data; a unit for calculating a varianceof the two histograms; and wherein the unit for judging whether theimage data is the sunset scene based on the variance.
 5. A computerreadable medium with a recorded program, the program being executed andperforming: converting color components R, G and B of an image data intohue data, lightness data and saturation data; calculating first productsof the hue data and the saturation data of the pixel of red and yellowin the image data; calculating second products of the hue data and thelightness data of the pixel of red and yellow in the image data; andjudging whether the image data is the sunset scene based on first andsecond products.
 6. A computer readable medium with a recorded programaccording to claim 5, the program further being executed and performing:calculating a histogram of the products of the hue data and thesaturation data; calculating a histogram of the products of the hue dataand the lightness data; calculating a variance of the two histograms;and wherein judging whether the image data is the sunset scene based onthe variance.
 7. A judging method of the color image covered with aspecific color, comprising: converting color components R, G and B of animage data into hue data, lightness data and saturation data;calculating histograms of hue data, lightness data and saturation data;calculating a first data concentration of the hue data in firstpredetermined range; calculating a second data concentration of the huedata in second predetermined range which is different from firstpredetermined range; and judging the color image covered with a specificcolor based on the first data concentration and the second dataconcentration.
 8. A judging method of the color image covered with aspecific color according to claim 7, wherein second predetermined rangeis wider than first predetermined range.
 9. An image processingapparatus, comprising: a memory which stores an image data of a colorimage; a judge section which judges whether correction of the colorimage based on the color image covered with a specific color; whereinthe judge section comprises; a unit for converting color components R, Gand B of an image data into hue data, lightness data and saturationdata; a unit for calculating histograms of hue data, lightness data andsaturation data; a unit for calculating a first data concentration ofthe hue data in first predetermined range; a unit for calculating asecond data concentration of the hue data in second predetermined rangewhich is different from first predetermined range; and a unit forjudging the color image covered with a specific color based on the firstdata concentration and the second data concentration.
 10. An imageprocessing apparatus according to claim 9, wherein second predeterminedrange is wider than first predetermined range.
 11. A computer readablemedium with a recorded program, the program being executed andperforming: converting color components R, G and B of an image data intohue data, lightness data and saturation data; calculating histograms ofhue data, lightness data and saturation data; calculating a first dataconcentration of the hue data in first predetermined range; calculatinga second data concentration of the hue data in second predeterminedrange which is different from first predetermined range; and judging thecolor image covered with a specific color based on the first dataconcentration and the second data concentration.
 12. A computer readablemedium with a recorded program according to claim 11, the program beingexecuted and performing: wherein second predetermined range is widerthan first predetermined range.